﻿namespace NTLib.Core.Log
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    /// <summary>
    /// Define a consumer that will treat the log 
    /// </summary>
    public interface ILogConsumer
    {
        #region Properties

        /// <summary>
        /// Gets types of data the NTlog must filter for this consumer. If null no filter will be apply.
        /// </summary>
        /// <value>
        /// Collection of types used to filter. Following this collection, only log data in type or child of one type present will be send to the consumer.
        /// </value>
        IReadOnlyCollection<Type> FilterTypes { get; }

        /// <summary>
        /// Gets types of context the NTlog must filter for this consumer. If null no filter will be apply.
        /// </summary>
        /// <value>
        /// Collection of types used to filter. Following this collection, only log data in type or child of one type present will be send to the consumer.
        /// </value>
        IReadOnlyCollection<Type> FilterContextTypes { get; }

        #endregion

        #region Methods

        /// <summary>
        /// Manager the specified log.
        /// </summary>
        /// <param name="log">The log.</param>
        void Log(LogContainer log);

        /// <summary>
        /// Flushes this instance.
        /// </summary>
        Task FlushAsync();

        #endregion
    }
}
